package com.qf5.mapper;

import com.qf5.domain.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface StudentMapper {

    @Select("select * from student")
    List<Student> findAll();

    @Select("select * from student where id=#{id}")
    Student findById(Integer id);

    @Insert("insert into student values (null,#{name},#{age},#{insertTime})")
    int insert(Student stu);

    @Delete("delete from student where id=#{id}")
    int delete(Integer id);

    @Update("update student set name=#{name},age=#{age},insert_time=#{insertTime} where id=#{id}")
    int update(Student stu);

    @Select("select * from student where name=#{name} and age=#{age}")
    Student findByNameAndAge(@Param("name") String name, @Param("age") Integer age);
}
